//1. 建立请求对象

const htp = require("http");
const qss = require("querystring");
//2. 创建服务器实例
const server = htp.createServer();

// 请求监听函数
server.on("request", (req, res) => {
  const url = new URL(req.url, "http://127.0.0.1");
  console.log(url.searchParams);

  res.end("Hello World");
});
//4. 启动服务器
server.listen(80, () => {
  console.log("Server running at http://127.0.0.1");
});
